package application.translators.impl;

import application.model.TypesCompositionModel;
import application.model.TypesCompositionsModel;
import application.translators.Translator;
import mappings.TypesComposition;

import java.util.List;

public class TypesCompositionsTranslator implements Translator<List<TypesComposition>, TypesCompositionsModel>
{
    @Override
    public TypesCompositionsModel translate(List<TypesComposition> input)
    {
        TypesCompositionsModel typesCompositionsModel = new TypesCompositionsModel();

        for(TypesComposition typesComposition : input)
        {
            TypesCompositionModel typesCompositionModel = new TypesCompositionModel();

            typesCompositionModel.setName(typesComposition.getTypes().getName());

            typesCompositionsModel.addTypesComposition(typesCompositionModel);
        }

        return typesCompositionsModel;
    }
}
